home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / clipper / nftroff.zip / 7.tr < prev    next >
Text File  |  1991-11-21  |  18KB  |  1,228 lines

  1. .de }n
  2. .bp
  3. .sp .5i
  4. ..
  5. .wh -.8i }n
  6. .sp .5i
  7. .po -.4i
  8. .ll 7.5i
  9. .ps 9
  10. .vs 9
  11. .in 0i
  12. .ta 1.63265i
  13. .sp 2
  14. .ne 20
  15. .ps +3
  16. .vs +3
  17. FT_DFCLOSE()    Close file displayed by FT_DISPFILE()
  18. .br
  19. .ta
  20. .in 0.08i
  21. .ps -3
  22. .vs -3
  23. .sp 2
  24. \fBFT_DFCLOSE()
  25. Close file displayed by FT_DISPFILE()
  26. .in 0i
  27. .br
  28. \l'6.24i'
  29. .br
  30. .sp
  31. .in 0.08i
  32. \fBSyntax
  33. .sp
  34. .in 0.4i
  35. \fBFT_DFCLOSE() -> NIL
  36. .sp
  37. .in 0.08i
  38. \fBArguments
  39. .sp
  40. .in 0.4i
  41. None
  42. .sp
  43. .in 0.08i
  44. \fBReturns
  45. .sp
  46. .in 0.4i
  47. NIL
  48. .sp
  49. .in 0.08i
  50. \fBDescription
  51. .sp
  52. .in 0.4i
  53. Closes the file opened by FT_DFSETUP()
  54. .sp
  55. .in 0.08i
  56. \fBExamples
  57. .sp
  58. .in 0.4i
  59. @ 4,9 TO 11,71
  60. .sp
  61. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  62. .in 1.36i
  63. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  64. .sp
  65. .in 0.4i
  66. cKey = FT_DISPFILE()
  67. .sp
  68. FT_DFCLOSE()
  69. .sp
  70. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  71. .sp
  72. .in 0.08i
  73. \fBSource:\fR DFILE\.PRG
  74. .sp
  75. \fBAuthor:\fR Mike Taylor
  76. .in 0i
  77. .sp
  78. .in 1.5i
  79. .ti -1.5i
  80. .ta 1.5i
  81. .ft B
  82. See Also:    
  83. .ft R
  84. FT_DFSETUP()
  85. , FT_DISPFILE()
  86. .ta 1.63265i
  87. .in 0i
  88. .sp 2
  89. .ne 20
  90. .ps +3
  91. .vs +3
  92. FT_DFSETUP()    Set up parameters for FT_DISPFILE()
  93. .br
  94. .ta
  95. .in 0.08i
  96. .ps -3
  97. .vs -3
  98. .sp 2
  99. \fBFT_DFSETUP()
  100. Set up parameters for FT_DISPFILE()
  101. .in 0i
  102. .br
  103. \l'6.24i'
  104. .br
  105. .sp
  106. .in 0.08i
  107. \fBSyntax
  108. .sp
  109. .in 0.4i
  110. .br
  111. \fBFT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ;
  112. .in 1.12i
  113. .ta 4.16i
  114. .br
  115. \fB<nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>,    ;
  116. .br
  117. .ta
  118. .br
  119. \fB<lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
  120. .sp
  121. .in 0.08i
  122. \fBArguments
  123. .sp
  124. .in 0.64i
  125. .ta 1.12i
  126. \fB<cInFile>\fR    - text file to display (full path and filename)
  127. .br
  128. .ta
  129. .ta 1.12i
  130. \fB<nTop>\fR    - upper row of window
  131. .br
  132. .ta
  133. .ta 1.12i
  134. \fB<nLeft>\fR    - left col of window
  135. .br
  136. .ta
  137. .ta 1.12i
  138. \fB<nBottom>\fR    - lower row of window
  139. .br
  140. .ta
  141. .ta 1.12i
  142. \fB<nRight>\fR    - right col of window
  143. .br
  144. .ta
  145. .ta 1.12i
  146. \fB<nStart>\fR    - line to place highlight at startup
  147. .br
  148. .ta
  149. .ta 1.12i 3.04i
  150. \fB<nCNormal>\fR    - normal text color    (numeric attribute)
  151. .br
  152. .ta
  153. .ta 3.04i
  154. \fB<nCHighlight>\fR - text highlight color    (numeric attribute)
  155. .br
  156. .ta
  157. .ta 1.12i 3.04i
  158. \fB<cExitKeys>\fR    - terminating key list    (each byte of string is a
  159. .br
  160. .ta
  161. .in 1.92i
  162. key code)
  163. .in 0.64i
  164. .ta 1.12i
  165. \fB<lBrowse>\fR    - act-like-a-browse-routine flag
  166. .br
  167. .ta
  168. .ta 1.12i
  169. \fB<nColSkip>\fR    - col increment for left/right arrows
  170. .br
  171. .ta
  172. .ta 1.12i
  173. \fB<nRMargin>\fR    - right margin - anything to right is truncated
  174. .br
  175. .ta
  176. .ta 1.12i
  177. \fB<nBuffSize>\fR    - size of the paging buffer
  178. .br
  179. .ta
  180. .sp
  181. .in 0.08i
  182. \fBReturns
  183. .sp
  184. .in 0.4i
  185. 0 if successful, FError() code if not
  186. .sp
  187. .in 0.08i
  188. \fBDescription
  189. .sp
  190. .in 0.4i
  191. Note: make sure you allocate a buffer large enough to hold enough
  192. data for the number of lines that you have in the window\.  Use the
  193. following formula as a guideline:
  194. .sp
  195. .in 0.64i
  196. buffer size = (# of line) + 1 * RMargin
  197. .sp
  198. .in 0.4i
  199. This is the smallest you should make the buffer\.  For normal use,
  200. 4096 bytes is recommended
  201. .sp
  202. .in 0.08i
  203. \fBExamples
  204. .sp
  205. .in 0.4i
  206. @ 4,9 TO 11,71
  207. .sp
  208. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  209. .in 1.28i
  210. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  211. .sp
  212. .in 0.4i
  213. cKey = FT_DISPFILE()
  214. .sp
  215. FT_DFCLOSE()
  216. .sp
  217. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  218. .sp
  219. .in 0.08i
  220. \fBSource:\fR DFILE\.PRG
  221. .sp
  222. \fBAuthor:\fR Mike Taylor
  223. .in 0i
  224. .sp
  225. .in 1.5i
  226. .ti -1.5i
  227. .ta 1.5i
  228. .ft B
  229. See Also:    
  230. .ft R
  231. FT_DISPFILE()
  232. , FT_DFCLOSE()
  233. .ta 1.63265i
  234. .in 0i
  235. .sp 2
  236. .ne 20
  237. .ps +3
  238. .vs +3
  239. FT_DISPFILE()    Browse a text file
  240. .br
  241. .ta
  242. .in 0.08i
  243. .ps -3
  244. .vs -3
  245. .sp 2
  246. \fBFT_DISPFILE()
  247. Browse a text file
  248. .in 0i
  249. .br
  250. \l'6.24i'
  251. .br
  252. .sp
  253. .in 0.08i
  254. \fBSyntax
  255. .sp
  256. .in 0.4i
  257. \fBFT_DISPFILE() -> cExitkey
  258. .sp
  259. .in 0.08i
  260. \fBArguments
  261. .sp
  262. .in 0.4i
  263. None
  264. .sp
  265. .in 0.08i
  266. \fBReturns
  267. .sp
  268. .in 0.4i
  269. The ASCII keystroke that terminated FT_DISPFILE()
  270. .sp
  271. .in 0.08i
  272. \fBDescription
  273. .sp
  274. .in 0.4i
  275. This routine displays a text file within a defined window using as
  276. little memory as possible\.  The text file to display has to be
  277. present or an error value of 0 is returned (as a character\.)
  278. .sp
  279. Assumptions: The routine assumes that all lines are terminated
  280. .in 1.44i
  281. with a CR/LF sequence (0x0d and 0x0a)\.
  282. .sp
  283. .in 0.4i
  284. .ta 1.04i
  285. Note:    Make sure you allocate a buffer large enough to hold
  286. .br
  287. .ta
  288. .in 1.44i
  289. enough data for the number of lines that you have
  290. in the window\.  Use the following formula as a
  291. guideline - buffer size = (# of line) + 1 * RMargin
  292. this is the smallest you should make the buffer and
  293. for normal use I recommend 4096 bytes\.
  294. .sp
  295. .in 0.4i
  296. .ta 2i
  297. Cursor Keys: Up, Down    - moves the highlight line
  298. .br
  299. .ta
  300. .in 1.44i
  301. Left, Right - moves the window over nColSkip col\'s
  302. .ta 0.96i
  303. Home    - moves the window to the far left
  304. .br
  305. .ta
  306. .ta 0.96i
  307. End    - moves the window to the nRMargin column
  308. .br
  309. .ta
  310. .ta 0.96i
  311. PgUp, PgDn    - moves the highlight one page
  312. .br
  313. .ta
  314. .ta 0.96i
  315. Ctrl-PgUp    - moves the highlight to the file top
  316. .br
  317. .ta
  318. .ta 0.96i
  319. Ctrl-PgDn    - moves the highlight to the file bottom
  320. .br
  321. .ta
  322. .ta 0.96i
  323. Ctrl-Right    - moves the window 16 col\'s to the right
  324. .br
  325. .ta
  326. .ta 0.96i
  327. Ctrl-Left    - moves the window 16 col\'s to the left
  328. .br
  329. .ta
  330. .sp
  331. Esc, Return - terminates the function
  332. .sp
  333. All other keys are ignored unless they are specified
  334. within cExitKeys parameter\.  This list will tell the
  335. routine what keys terminate the function\.  Special
  336. keys must be passed by a unique value and that value
  337. can be found by looking in the keys\.h file\.
  338. .sp
  339. .in 0.08i
  340. \fBExamples
  341. .sp
  342. .in 0.4i
  343. @ 4,9 TO 11,71
  344. .sp
  345. FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
  346. .in 1.36i
  347. "AaBb" + Chr(143), \.T\., 5, 132, 4096)
  348. .sp
  349. .in 0.4i
  350. cKey = FT_DISPFILE()
  351. .sp
  352. FT_DFCLOSE()
  353. .sp
  354. @ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
  355. .sp
  356. .in 0.08i
  357. \fBSource:\fR DISPC\.C
  358. .sp
  359. \fBAuthor:\fR Mike Taylor
  360. .in 0i
  361. .sp
  362. .in 1.5i
  363. .ti -1.5i
  364. .ta 1.5i
  365. .ft B
  366. See Also:    
  367. .ft R
  368. FT_DFSETUP()
  369. , FT_DFCLOSE()
  370. .ta 1.63265i
  371. .in 0i
  372. .sp 2
  373. .ne 20
  374. .ps +3
  375. .vs +3
  376. FT_FEOF()    Determine when end of text file is encountered
  377. .br
  378. .ta
  379. .in 0.08i
  380. .ps -3
  381. .vs -3
  382. .sp 2
  383. \fBFT_FEOF()
  384. Determine when end of text file is encountered
  385. .in 0i
  386. .br
  387. \l'6.24i'
  388. .br
  389. .sp
  390. .in 0.08i
  391. \fBSyntax
  392. .sp
  393. .in 0.4i
  394. \fBFT_FEOF() -> lResult
  395. .sp
  396. .in 0.08i
  397. \fBArguments
  398. .sp
  399. .in 0.4i
  400. None
  401. .sp
  402. .in 0.08i
  403. \fBReturns
  404. .sp
  405. .in 0.4i
  406. \.T\. if an attempt was made to skip past the last record of
  407. the currently selected text file, otherwise \.F\.
  408. .sp
  409. .in 0.08i
  410. \fBDescription
  411. .sp
  412. .in 0.4i
  413. This function is similar to the CLIPPER Eof() function\.
  414. .sp
  415. A text file "record" is a line of text terminated by a CRLF pair\.
  416. .sp
  417. .in 0.08i
  418. \fBExamples
  419. .sp
  420. .in 0.4i
  421. .br
  422. FT_FUSE( "FTTEXT\.C" )
  423. .br
  424. FT_FGOBOT()
  425. .ta 1.52i
  426. .br
  427. ? FT_FEOF()    // \.F\.
  428. .br
  429. .ta
  430. .br
  431. FT_FSKIP()
  432. .ta 1.52i
  433. .br
  434. ? FT_FEOF()    // \.T\.
  435. .br
  436. .ta
  437. .sp
  438. .in 0.08i
  439. \fBSource:\fR FTTEXT\.C
  440. .sp
  441. \fBAuthor:\fR Brice de Ganahl
  442. .in 0i
  443. .sp
  444. .in 1.5i
  445. .ti -1.5i
  446. .ta 1.5i
  447. .ft B
  448. See Also:    
  449. .ft R
  450. FT_FUSE()
  451. , FT_FGOBOT()
  452. , FT_FSKIP()
  453. .ta 1.63265i
  454. .in 0i
  455. .sp 2
  456. .ne 20
  457. .ps +3
  458. .vs +3
  459. FT_FGOBOT()    Go to the last record in a text file
  460. .br
  461. .ta
  462. .in 0.08i
  463. .ps -3
  464. .vs -3
  465. .sp 2
  466. \fBFT_FGOBOT()
  467. Go to the last record in a text file
  468. .in 0i
  469. .br
  470. \l'6.24i'
  471. .br
  472. .sp
  473. .in 0.08i
  474. \fBSyntax
  475. .sp
  476. .in 0.4i
  477. \fBFT_FGOBOT() -> NIL
  478. .sp
  479. .in 0.08i
  480. \fBArguments
  481. .sp
  482. .in 0.4i
  483. None
  484. .sp
  485. .in 0.08i
  486. \fBReturns
  487. .sp
  488. .in 0.4i
  489. NIL
  490. .sp
  491. .in 0.08i
  492. \fBDescription
  493. .sp
  494. .in 0.4i
  495. This function moves the record pointer to the last record of the
  496. file in the currently selected text file workarea\.
  497. .sp
  498. A text file "record" is a line of text terminated by a CRLF pair\.
  499. .sp
  500. .in 0.08i
  501. \fBExamples
  502. .sp
  503. .in 0.4i
  504. .br
  505. // read last line
  506. .br
  507. FT_FUSE( "text\.c" )
  508. .br
  509. FT_FGOBOT()
  510. .br
  511. ? FT_FREADLN()
  512. .sp
  513. .in 0.08i
  514. \fBSource:\fR FTTEXT\.C
  515. .sp
  516. \fBAuthor:\fR Brice de Ganahl
  517. .in 0i
  518. .sp
  519. .in 1.5i
  520. .ti -1.5i
  521. .ta 1.5i
  522. .ft B
  523. See Also:    
  524. .ft R
  525. FT_FSELECT()
  526. , FT_FUSE()
  527. , FT_FGOTOP()
  528. , FT_FRECNO()
  529. , FT_FREADLN()
  530. .ta 1.63265i
  531. .in 0i
  532. .sp 2
  533. .ne 20
  534. .ps +3
  535. .vs +3
  536. FT_FGOTO()    Move record pointer to specific record in a text file
  537. .br
  538. .ta
  539. .in 0.08i
  540. .ps -3
  541. .vs -3
  542. .sp 2
  543. \fBFT_FGOTO()
  544. Move record pointer to specific record in a text file
  545. .in 0i
  546. .br
  547. \l'6.24i'
  548. .br
  549. .sp
  550. .in 0.08i
  551. \fBSyntax
  552. .sp
  553. .in 0.4i
  554. \fBFT_FGOTO( nLine ) -> NIL
  555. .sp
  556. .in 0.08i
  557. \fBArguments
  558. .sp
  559. .in 0.4i
  560. \fB<nLine>\fR is the record number to go to\.
  561. .sp
  562. .in 0.08i
  563. \fBReturns
  564. .sp
  565. .in 0.4i
  566. NIL
  567. .sp
  568. .in 0.08i
  569. \fBDescription
  570. .sp
  571. .in 0.4i
  572. This function moves the record pointer to a specific record
  573. in the fi